<!DOCTYPE html>
<html lang="en" class="bg-dark">
    
    <head>
        <meta charset="utf-8" />
        <meta name="renderer" content="webkit">
        <title>轻时光微信运营</title>
        <meta name="description" content=""/>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
        <link rel="stylesheet" href="__NOTE__/css/app.v2.css" type="text/css" />
        <link rel="stylesheet" href="__NOTE__/css/font.css" type="text/css" cache="false"/>
        <!--[if lt IE 9]>
            <script src="js/ie/html5shiv.js" cache="false">
            </script>
            <script src="js/ie/respond.min.js" cache="false">
            </script>
            <script src="js/ie/excanvas.js" cache="false">
            </script>
        <![endif]-->
    </head>
     <body>
        <section id="content" class="m-t-lg wrapper-md animated fadeInUp">
            <div class="container aside-xxl">
                <a class="navbar-brand block" href="index.html">
                    Marry+
                </a>
                <section class="panel panel-default bg-white m-t-lg">
                    <header class="panel-heading text-center">
                        <strong>
                            注册账号
                        </strong>
                    </header>
                    <form method="post" action="index.html" class="panel-body wrapper-lg">
                        {if condition="isset($ok)"}
                        <h4>{$ok}</h4>
                        </br>
                        {else/}
                        <div class="form-group">
                            <label class="control-label">公司/集团</label>
                            <input type="text" placeholder="例如薇拉集团" class="form-control input-xs" id="name"  name="name"  value=""  autocomplete="on">
                        </div>
                        <div class="form-group">
                            <label class="control-label">集团电话</label>
                            <input type="text" placeholder="18888888888" class="form-control input-xs" id="mobile"  name="mobile"  value=""  autocomplete="on">
                        </div>
                        <div class="form-group">
                            <label class="control-label">设置密码</label>
                            <input type="password" id="password" placeholder="Password" class="form-control input-xs">
                        </div>
                        <!-- <div class="form-group">
                            <label class="control-label">
                            <img src="{:captcha_src()}" onclick="javascript: this.src='{:captcha_src()}?tm='+Math.random();" style="float:right;cursor: pointer"/>
                             </label>
                            <input type="password" name="code" id="code" placeholder="输入上方验证码" class="form-control input-lg">
                        </div> -->
                        <div class="checkbox">
                            <label>
                                <input type="checkbox">
                                记住密码
                            </label>
                            <a href="#" class="pull-right m-t-xs">
                            <small>
                                忘记密码?
                            </small>
                        </a>
                        </div>
                        <a  id="signup_btn" class="btn btn-block btn-primary" >注册</a>
                        <div class="line line-dashed"></div>
                        <p class="text-muted text-center">
                            <small>
                                已经有账号?
                            </small>
                        </p>
                        {/if}
                        <a href="url('login/index')" class="btn btn-default btn-block">
                            立即登录
                        </a>
                    </form>
                </section>
            </div>
        </section>
        <!-- footer -->
        <footer id="footer">
            <div class="text-center padder">
                <p>
                    <small>
                        咸鱼计算科技有限公司
                        <br>
                        &copy; 2011-2016
                    </small>
                </p>
            </div>
        </footer>
        <!-- / footer -->
        <script src="__NOTE__/js/app.v2.js">
        </script>
        <!-- Bootstrap -->
        <!-- App -->

<script type="text/javascript">
    document.onkeydown=function(event){
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if(e && e.keyCode==13){ // enter 键
            $('#signup_btn').click();
        }
    };
    var lock = false;
    $(function () {
        $('#signup_btn').click(function(){
            if(lock){
                return;
            }
            lock = true;
            $('#err_msg').hide();
            $('#signup_btn').removeClass('btn-success').addClass('btn-danger').text('登陆中...');
            var name = $('#name').val();
            var mobile = $('#mobile').val();
            var password = $('#password').val();
            var code = $('#code').val();
            $.post("{:url('signup/doSignup')}",{'name':name,'mobile':mobile, 'password':password, 'code':code},function(data){
                lock = false;
                $('#signup_btn').val('登录').removeClass('btn-danger').addClass('btn-success');
                if(data.code!=1){
                    $('#signup_btn').removeClass('btn-success').addClass('btn-danger').text(data.msg);
                    setInterval(function(){
                     $('#signup_btn').text('登录').removeClass('btn-danger').addClass('btn-success');
                    } ,2000);
                    return;
                }else{
                     $('#signup_btn').text('恭喜，注册成功').removeClass('btn-danger').addClass('btn-success');
                     window.location.href=data.data;
                }
            });
        });
    });
</script>


</body>
</html>

